package com.store.service;

import com.store.common.Result;
import com.store.dto.OrderDTO;
import com.store.entity.Order;
import com.store.entity.Product;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;

public interface OrderService {
    Result getList(Integer pageNum, Integer pageSize, String status);
    Result getById(Long id);
    List<Order> getCurrentUserOrders();
    Result create(OrderDTO orderDTO);
    Result update(OrderDTO orderDTO);
    void delete(List<Long> ids);
    void updateStatus(Long id, String status);
    Map<String, Object> getStatistics(String startDate, String endDate);
    Map<String, Object> getDailyStatistics();
    List<Map<String, Object>> getTopSellingProducts(Integer limit);
    
    // 新增统计相关方法
    long countAll();
    int countByStatus(String status);
    double calculateTotalSales();
    List<Order> findRecentOrders(int limit);
    Map<String, Object> getSalesData(String startDate, String endDate);
    
    int countPendingOrders();
    BigDecimal getTodaySales();
    BigDecimal getMonthlySales(LocalDate date);
    BigDecimal getTotalSales();
    Product getTopSellingProduct();

    List<OrderDTO> getOrderList(Integer pageNum, Integer pageSize);
    List<OrderDTO> getAllOrders();
    OrderDTO getOrderById(Long id);
    OrderDTO createOrder(OrderDTO orderDTO);
    OrderDTO updateOrder(OrderDTO orderDTO);
    void deleteOrders(List<Long> ids);
    
    /**
     * 更新订单购买数量
     * @param orderId 订单ID
     * @param quantity 新的购买数量
     * @return 更新后的订单信息
     */
    OrderDTO updateOrderQuantity(Long orderId, Integer quantity);
} 